package org.fujay.langchain4jserver.domain.model.vo;

import cn.hutool.core.util.IdUtil;
import org.springframework.util.Assert;

import java.io.Serial;
import java.io.Serializable;

/**
 * 模型ID值对象
 */
public record ModelId(Long id) implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    public ModelId {
        Assert.notNull(id, "Model ID cannot be null");
    }

    public static ModelId create() {
        return new ModelId(IdUtil.getSnowflakeNextId());
    }

    /**
     * 获取原始ID值
     *
     * @return Long ID
     */
    public Long value() {
        return id;
    }
}
